<template>
	<view>
		<uni-list>
			<uni-list-chat @click="tiao(index)" clickable avatar-circle v-for="(item,index) in serverlist" :avatar="baseUrl+item.imgUrl" :title="item.serviceName"></uni-list-chat>
		</uni-list>
	</view>
</template>

<script>
	import {getserverlist,baseurl} from '@/utils/index/index.js'
	export default {
		data() {
			return {
				serverlist:[],
								baseUrl:""
				
			}
		},
		onLoad() {
					this.baseUrl=baseurl
					this.getserverlis()
				},
		methods: {
			tiao(index){
				console.log(index)
				switch(index){
					case 5:uni.navigateTo({
						url:"/pages/car/car",
					})
					break;
					case 2:uni.navigateTo({
						url:"/pages/book/book"
					})
					break;
					case 6:uni.navigateTo({
						url:"/pages/subway/subway"
					})
					break;
					case 7:uni.navigateTo({
						url:"/pages/bus/bus"
					})
					break;
					case 13:uni.navigateTo({
						url:"/pages/movie/movie"
					})
					default:break;
				}
			},
			async getserverlis(){
							const res=await getserverlist()
							console.log(res)
							this.serverlist=res.data.rows
						}
			
		}
	}
</script>

<style>

</style>
